# -*- coding: utf-8 -*-
"""
 @Time    : 2021/2/24 下午3:45
 @Author  : tgy
 
"""


def eat(self):
    print('eat')


class Extal(type):
    ...

    def __init__(self, classname, superclass, attributedict):
        ...
        print(self,superclass,attributedict)
        self.eat = eat

    def __new__(cls, *args, **kwargs):
        return super().__new__(cls,*args,**kwargs)

# Person = Extal('Person',(object,),{})

class Person(metaclass=Extal):

    def __init__(self):
        ...



def add_attr(clz):
    ...
    clz.eat = eat
    return clz


@add_attr
class Dog:
    ...


if __name__ == '__main__':
    ...
    print(Person.eat)
    print(Dog.eat)